<template>
<div>
<button @ click="currentTab ='Tab1'">音乐</button>
<button @ click="currentTab ='Tab2'">视频</button>
<button @ click="currentTab ='Tab3'">新闻</button>
<keep-alive>
<component :is=" currentTab" ></component>
</keep-alive>
</div>
</template>
<script>
import Tabl from "./components/TabCom1. vue" ;
import Tab2 frm "./components/TabCom2. vue";
import Tab3 from "./components/TabCom3. vue" ;
export default{
    date(){
        return{
            currentTab:"Tab1",
        };
    },
//注册组件
components:{
    Tab1,
    Tab2,
    Tab3
},
};
</script>
<style scoped>
</style>